home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / unixlib.lha / unix / test / socks / getaline.c next >
C/C++ Source or Header  |  1996-10-22  |  451b  |  23 lines

  1. #include <stdio.h>
  2. #include <dos/dosextens.h>
  3. #include <proto/dos.h>
  4.  
  5. int
  6. main(void)
  7. {
  8.     char userinput[256];
  9.     int howmany = 0;
  10.     BPTR dos_fh;
  11.  
  12.     dos_fh = Open("CON:10/10/500/150/New Window",MODE_NEWFILE);
  13.     Write(dos_fh,"Please type an input line, then press RETURN\n",45);
  14.     while(howmany != 1) {
  15.         howmany = Read(dos_fh,userinput,255);
  16.         userinput[howmany] = '\0';
  17.         printf("%s",userinput);
  18.         fflush(stdout);
  19.     }
  20.     Close(dos_fh);
  21.     return 0;
  22. }
  23.